/**
 * A说B说谎，B说C说谎。C说A与B都在说谎。
 * 问着三人中谁说的是真话，谁说的是嘉华
 * --
 * 题解：
 *  若A 说的是真话，则 a = 1 && b = 0
 *  若A 说的是假话, 则 a = 0 && b = 1
 * 同理
 *  B 为真         b = 1 && c = 0
 *  B 为假         b = 0 && c = 1
 *  C  为真        c = 1 && a + b = 0
 *  c 为假         c = 0 && a + b != 0
 *
 */

#include <stdio.h>

int main()
{
    for (int a = 0; a <= 1; a++)
    {
        for (int b = 0; b <= 1; b++)
        {
            for (int c = 0; c <= 1; c++)
            {
                if ((a && !b || !a && b) && (b && !c || !b && c) && (c && a + b == 0 || !c & a + b != 0))
                {
                    printf("A told a %s.\n", a ? "truth" : "lie");
                    printf("B told a %s.\n", b ? "truth" : "lie");
                    printf("C told a %s.\n", c ? "truth" : "lie");
                }
            }
        }
    }
}